projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5665f50
)
sunxi: Use memcmp for mctl_mem_matches
author
Hans de Goede
<
[email protected]
>
Mon, 8 Dec 2014 13:17:08 +0000
(14:17 +0100)
committer
Hans de Goede
<
[email protected]
>
Wed, 14 Jan 2015 13:56:37 +0000
(14:56 +0100)
Use memcmp for mctl_mem_matches instead of DIY.
Signed-off-by: Hans de Goede <
[email protected]
>
Acked-by: Ian Campbell <
[email protected]
>
arch/arm/include/asm/arch-sunxi/dram.h
patch
|
blob
|
history
diff --git
a/arch/arm/include/asm/arch-sunxi/dram.h
b/arch/arm/include/asm/arch-sunxi/dram.h
index 0bf718c3a4bbd6ee491727d72bafc8ce2dcfba4d..a8a37d57f8549b76a63fb47cebb31dad4f8009f5 100644
(file)
--- a/
arch/arm/include/asm/arch-sunxi/dram.h
+++ b/
arch/arm/include/asm/arch-sunxi/dram.h
@@
-55,15
+55,9
@@
static inline void mctl_mem_fill(void)
*/
static inline bool mctl_mem_matches(u32 offset)
{
- int i, matches = 0;
-
- for (i = 0; i < MCTL_MEM_FILL_MATCH_COUNT; i++) {
- if (readl(CONFIG_SYS_SDRAM_BASE + i * 4) ==
- readl(CONFIG_SYS_SDRAM_BASE + offset + i * 4))
- matches++;
- }
-
- return matches == MCTL_MEM_FILL_MATCH_COUNT;
+ return memcmp((u32 *)CONFIG_SYS_SDRAM_BASE,
+ (u32 *)(CONFIG_SYS_SDRAM_BASE + offset),
+ MCTL_MEM_FILL_MATCH_COUNT * 4) == 0;
}
#endif /* _SUNXI_DRAM_H */